//
//  LSLPlayerView.h
//  LSL_IJKPlayer
//
//  Created by 大龙 on 18/1/4.
//  Copyright © 2018年 LSL. All rights reserved.
//

#import <UIKit/UIKit.h>
#import <IJKMediaFramework/IJKFFMoviePlayerController.h>
#import "IJKMediaControl.h"
#import <IJKMediaFramework/IJKMediaPlayback.h>
#import "UIDevice+LSLDevice.h"
#import "ZXVideoPlayerVolumeView.h"
#import "ZXVideoPlayerBrightnessView.h"
@import MediaPlayer;
@import AVFoundation;
// 枚举值，包含水平移动方向和垂直移动方向
typedef NS_ENUM(NSInteger, PanDirection){
    PanDirectionHorizontalMoved, //横向移动
    PanDirectionVerticalMoved    //纵向移动
};

@protocol PlayerViewDelegate <NSObject>

/*
 *从全屏回到小屏cell上
 */

- (void)returnPlayViewOnCellWithIndexPath:(NSIndexPath *)indexPath;
@end
@interface LSLPlayerView : UIView<UIGestureRecognizerDelegate>

@property(nonatomic,strong)IJKFFMoviePlayerController * player;
/** player所在cell的indexPath */
@property (nonatomic, strong) NSIndexPath         *indexPath; //添加的cell索引

@property (nonatomic, strong) IJKMediaControl *mediaControl; //控制器

@property (nonatomic, assign) BOOL tapTag;    //判断手势是否已经添加过

@property (nonatomic,strong) UIButton *defaultBackBtn;//播放器返回按钮

@property (nonatomic,strong)id <PlayerViewDelegate>delegate;//播放器的代理

/// 亮度指示器
@property (nonatomic, strong, readwrite) ZXVideoPlayerBrightnessView *brightnessIndicatorView;
/// 音量指示器
@property (nonatomic, strong, readwrite) ZXVideoPlayerVolumeView *volumeIndicatorView;

/** 定义一个实例变量，保存枚举值 */
@property (nonatomic, assign) PanDirection        panDirection;

/** 是否在调节音量*/
@property (nonatomic, assign) BOOL                isVolume;

/** 滑杆 */
@property (nonatomic, strong) UISlider            *volumeViewSlider;




#pragma mark ---- 创建单例 ----
+ (instancetype)sharePlayerView;

#pragma mark ---- 根据URL创建播放器 ----
- (void)setVideoURL:(NSURL *)Videourl;
#pragma mark ---- 根据URL创建播放器在TableView上 ----
- (void)setVideoURL:(NSURL *)Videourl AtIndexPath:(NSIndexPath *)indexPath;

- (void)resetPlayer;
@end
